import { Descriptions } from 'antd';
import React from 'react';

interface CoachDetailProps {
  data: API.ICoach;
}

const CoachDetail: React.FC<CoachDetailProps> = ({ data }) => {
  const getValueLabel = (value: any, map: Record<string, string>) => {
    return map[value] || value || '-';
  };

  const genderMap = {
    0: '男',
    1: '女',
  };

  const statusMap = {
    1: '在职',
    2: '休假',
    3: '离职',
  };

  return (
    <Descriptions column={2} bordered>
      <Descriptions.Item label="教练ID">{data.id}</Descriptions.Item>
      <Descriptions.Item label="用户ID">{data.userId || '-'}</Descriptions.Item>
      <Descriptions.Item label="姓名">{data.name}</Descriptions.Item>
      <Descriptions.Item label="性别">{getValueLabel(data.gender, genderMap)}</Descriptions.Item>
      <Descriptions.Item label="身份证号">{data.idCard}</Descriptions.Item>
      <Descriptions.Item label="联系电话">{data.phone}</Descriptions.Item>
      <Descriptions.Item label="联系地址">{data.address || '-'}</Descriptions.Item>
      <Descriptions.Item label="教练证编号">{data.licenseNumber}</Descriptions.Item>
      <Descriptions.Item label="教练证类型">{data.licenseType || '-'}</Descriptions.Item>
      <Descriptions.Item label="入职日期">{data.hireDate}</Descriptions.Item>
      <Descriptions.Item label="状态">{getValueLabel(data.status, statusMap)}</Descriptions.Item>
      <Descriptions.Item label="教学时长">{data.teachingHours} 小时</Descriptions.Item>
      <Descriptions.Item label="教学专长">{data.specialty || '-'}</Descriptions.Item>
      <Descriptions.Item label="备注" span={2}>{data.remark || '-'}</Descriptions.Item>
      <Descriptions.Item label="创建人">{data.createdBy}</Descriptions.Item>
      <Descriptions.Item label="创建时间">{data.createdAt}</Descriptions.Item>
      <Descriptions.Item label="更新人">{data.updatedBy || '-'}</Descriptions.Item>
      <Descriptions.Item label="更新时间">{data.updatedAt || '-'}</Descriptions.Item>
    </Descriptions>
  );
};

export default CoachDetail;
